// 测试管理员后台链接是否可访问
const https = require('https');
const http = require('http');

// 测试8000端口
const testPort = 8000;
const adminUrl = `http://localhost:${testPort}/static/admin_dashboard.html`;

console.log(`测试链接: ${adminUrl}`);

http.get(adminUrl, (res) => {
  console.log(`状态码: ${res.statusCode}`);
  console.log(`响应头: ${JSON.stringify(res.headers)}`);

  res.on('data', (d) => {
    process.stdout.write(d.toString().substring(0, 100) + '...');
  });

}).on('error', (e) => {
  console.error(`无法访问链接: ${e.message}`);
});